﻿Public Class Rrelacion

    Public Shared Function SeleccionarTodo(ByVal descEmpresa As String, ByVal DisplaySelect As Boolean) As List(Of Erelacion)
        Dim relacions As List(Of Erelacion) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                relacions = Drelacion.SeleccionarTodo(descEmpresa)
                If relacions Is Nothing Then relacions = New List(Of Erelacion)
                If DisplaySelect Then relacions.Insert(0, New Erelacion("00", "-- SELECCIONAR --"))
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return relacions
    End Function

End Class
